/*
 * Copyright (c) 2019.
 * 北京九思金信科技有限公司对该文件内容保留所有权利。
 * 未经许可，不得私自拷贝、传播、发布、引用该文件内容，违者将被追究法律责任。
 */

import Vue from 'vue'
import Router from 'vue-router'

Router.prototype.goBack = function () {
  this.isBack = true
  window.history.go(-1)
}

Vue.use(Router)

export default new Router({
  routes: [
    {
      // 客户管理
      path: '/custInfo',
      name: 'customerManagement',
      component: () => import('@/pages/mobile/components/customer/customerManagement'),
      children: [
        {
          path: '',
          name: 'cmIndex',
          component: () => import('@/pages/mobile/components/customer/CmIndex')
        },
        {
          path: 'cmAddIndex',
          name: 'cmAddIndex',
          component: () => import('@/pages/mobile/components/customer/CmAddList')
        },
        {
          path: 'cmSearch',
          name: 'cmSearch',
          component: () => import('@/pages/mobile/components/customer/CmSearch')
        }
      ]
    },
    {
      // 客户管理
      path: '/custInfoOCR',
      name: 'customerManagementOCR',
      component: () => import('@/pages/mobile/components/customerOCR/customerManagement'),
      children: [
        {
          path: '',
          name: 'cmIndexOCR',
          component: () => import('@/pages/mobile/components/customerOCR/CmIndex')
        },
        {
          path: 'cmAddIndexOCR',
          name: 'cmAddIndexOCR',
          component: () => import('@/pages/mobile/components/customerOCR/CmAddList')
        }
      ]
    },
    // 客户移交
    {
      path: '/transferFlowSubmitForm',
      name: 'handOver',
      component: () => import('@/pages/mobile/components/handOver/HandOver'),
      children: [{
        path: '',
        name: 'handOverIndex',
        component: () => import('@/pages/mobile/components/handOver/HandOverIndex')
      }]
    },
    {
      path: '/transferFlowCheckForm',
      name: 'handOver',
      component: () => import('@/pages/mobile/components/handOver/HandOver'),
      children: [{
        path: '',
        name: 'handOverIndex',
        component: () => import('@/pages/mobile/components/handOver/HandOverIndex')
      }]
    }
  ]
})
